package com.example.industrialpipelinemonitoring.utils;

import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * @author Dsy
 * @create 2021-11-04  20:22
 */
@Data
@AllArgsConstructor
public class AjaxResult<T> {
    //操作是否成功
    private boolean success;
    /**
     * 操作执行后的提示
     */
    private String msg;
    /**
     * 执行操作后需要传递到页面的数据
     */
    private T obj;

    public static AjaxResult success(Object data) {
        return new AjaxResult(true, "", data);
    }

    public static AjaxResult fail(String msg) {
        return new AjaxResult(false, msg, null);
    }
}
